home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 November / CHIP Kasım 1997.iso / ARACLAR / TER500 / 500TER._XE / SCRIPT.EXE / MINITERM.TSL < prev    next >
Encoding:
Text File  |  1995-08-14  |  3.5 KB  |  160 lines

  1. % -----------------------------------------------------------------------------
  2. % Mini Terminal Demonstration                          *TERMINATE PRESCRIPTION*
  3. % -----------------------------------------------------------------------------
  4. %
  5. %  Version          : 1.01
  6. %  Filename         : MINITERM.TSL
  7. %  Company          : SerWiz Comm
  8. %  Programmer       : Bo Bendtsen
  9. %  Module created   : 06 Aug 1995
  10. %  Latest revision  : 09-Aug-1995 by Joop Blokker
  11. %  Language/version : Terminate Prescription 1.00
  12. %  Remarks          : Easy demonstration to create the simplest terminal
  13. %
  14. % -----------------------------------------------------------------------------
  15.  
  16. SetTerminal 1
  17.  
  18. ClearScreen
  19. WriteAStr 48,25,31," Alt-X=Abort F1=AT&V  F2=ATI4 "
  20. SetAttr 7
  21.  
  22. print "Interface         : "
  23. Set Interf = GetInterface                        % Get Interface
  24. print Interf
  25. if Interf=0
  26.  Set InterfS = "No Device"
  27. else
  28.   if Interf=1
  29.     Set InterfS="Uart device"
  30.   else
  31.     if Interf=2
  32.       Set InterfS="INT 14h"
  33.     else
  34.       if Interf=3
  35.         Set InterfS="Fossil"
  36.       else
  37.         If Interf=4
  38.           Set InterfS="DigiBoard"
  39.         else
  40.           Set InterfS = "Unknown"
  41.         endif
  42.       endif
  43.     endif
  44.   endif
  45. endif
  46. println " - ",InterfS
  47.  
  48. print "Port              : ",                    % Get Port number
  49. Set Port = GetPort
  50. println Port
  51.  
  52. print "Baud              : ",                    % Get Baud
  53. Set Baud = GetBaud
  54. PrintLn Baud
  55.  
  56. print "Data bits         : ",                    % Get Databits
  57. Set DataBits = GetData
  58. PrintLn DataBits
  59.  
  60. print "Stop bits         : ",                    % Get Stopbits
  61. Set StopBits = GetStop
  62. PrintLn StopBits
  63.  
  64. print "Parity            : ",                    % Get Parity
  65. Set ParS = GetParity
  66. print ParS, " - "
  67. if ParS = "N"
  68.   Set ParityS = "None"
  69. else
  70.   if ParS = "O"
  71.     Set ParityS = "Odd"
  72.   else
  73.     if ParS = "E"
  74.       Set ParityS = "Even"
  75.     else
  76.       if ParS = "M"
  77.         Set ParityS = "Mark"
  78.       else
  79.         if ParS = "S"
  80.           Set ParityS = "Space"
  81.         else
  82.           Set ParityS = "Unknown"
  83.         endif
  84.       endif
  85.     endif
  86.   endif
  87. endif
  88.  
  89. println ParityS
  90.  
  91. print "Set Input  buffer : ",                    % Set Input buffer size
  92. Set InBuf = 1024
  93. println InBuf
  94.  
  95. print "Set Output buffer : ",                    % Set Output buffer size
  96. Set OutBuf = 1024
  97. println OutBuf
  98.  
  99. print "Set Flow Control  : ",                    % Set Flow Control
  100.  
  101. Set Flow = 1                                     % init
  102.  
  103. if Flow=0
  104.   Set FlowS = "None"
  105. else
  106.   if Flow=1
  107.     Set FlowS = "RTS/CTS"
  108.   else
  109.     if Flow=2
  110.       Set FlowS = "Xon/Xoff"
  111.     else
  112.       if Flow=3
  113.         Set FlowS = "DSR/DTR"
  114.       else
  115.         Set FlowS = "Unknown"
  116.       endif
  117.     endif
  118.   endif
  119. endif
  120. println FlowS
  121. println ""
  122. Println "Press Enter, please..."                 % Wait
  123. WaitEnter
  124. Scroll 1,1,1,80,20,20,7                          % Clear screen partial
  125.  
  126. % InitDirect Interf, Port, Baud, DataBits, StopBits, ParS, InBuf, OutBuf, Flow
  127.  
  128. If DeviceResult<>0
  129.   PrintLn "Error opening COM",GetPort
  130.   PrintLn "Result code: ",DeviceResult
  131.   PrintLn "Result text: ",DeviceResultStr(DeviceResult)
  132.   WaitEnter
  133.   Goto End
  134. Endif
  135.  
  136. Set Key=0
  137. Repeat
  138.   If CharsWaiting<>0
  139.     WriteTerminal GetChar
  140.   Endif
  141.   If Keypressed<>0
  142.     Set Key = GetKey
  143.     If Key=315
  144.       Send "AT&V^M"
  145.     Else
  146.       If Key=316
  147.         Send "ATI4^M"
  148.       Else
  149.         Send Chr(Key)
  150.       Endif
  151.     Endif
  152.   Endif
  153. Until Key=301
  154.  
  155. % CloseCom
  156.  
  157. :End
  158. RemoveWindow
  159.  
  160.